home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
lisp
/
kcl
/
akcl
/
akcl.lha
/
akcl
/
V
/
c
/
main.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-02-15
|
10KB
|
701 lines
Changes file for /usr/local/src/kcl/c/main.c
Created on Thu Feb 15 09:56:57 1990
Usage \n@s[Original text\n@s|Replacement Text\n@s]
See the file rascal.ics.utexas.edu:/usr2/ftp/merge.c
for a program to merge change files. Anything not between
"\n@s[" and "\n@s]" is a simply a comment.
This file was constructed using emacs and merge.el
Enhancements Copyright (c) W. Schelter All rights reserved.
by (Bill Schelter) wfs@carl.ma.utexas.edu
****Change:(orig (11 11 a))
@s[ IMPLEMENTATION-DEPENDENT
*/
@s| IMPLEMENTATION-DEPENDENT
*/
#define IN_MAIN
#ifdef KCLOVM
#include <ovm/ovm.h>
void change_contexts();
int ovm_process_created;
void initialize_process();
#endif
@s]
****Change:(orig (12 12 a))
@s[#include "include.h"
@s|#include "include.h"
#ifdef UNIX
#include <signal.h>
int segmentation_catcher();
#endif
@s]
****Change:(orig (13 13 a))
@s[
@s|
@s]
****Change:(orig (17 17 a))
@s[#ifdef BSD
#include <sys/time.h>
@s|#ifdef BSD
#include <sys/time.h>
#ifndef SGI
@s]
****Change:(orig (19 19 a))
@s[#include <sys/resource.h>
#endif
@s|#include <sys/resource.h>
#endif
#endif
@s]
****Change:(orig (30 33 d))
@s[object siVsystem_directory;
#ifdef UNIX
char *kcl_self;
#endif
@s|
@s]
****Change:(orig (34 34 a))
@s[
@s|
@s]
****Change:(orig (48 52 d))
@s[int ARGC;
char **ARGV;
#ifdef UNIX
char **ENVP;
@s,#endif
@s|
@s]
****Change:(orig (57 57 a))
@s[static object module_data;
@s|static object module_data;
static object siLmultiply_stacks;
int stack_multiple=1;
@s]
****Change:(orig (74 74 a))
@s[#endif
{
FILE *i;
#ifdef BSD
@s|#endif
{
FILE *i;
#ifdef BSD
#ifndef SGI
@s]
****Change:(orig (76 76 a))
@s[ struct rlimit rl;
#endif
@s| struct rlimit rl;
#endif
#endif
@s]
****Change:(orig (139 139 a))
@s[ }
GBC_enable = FALSE;
@s| }
GBC_enable = FALSE;
vs_org = value_stack;
@s]
****Change:(orig (141 141 a))
@s[ vs_limit = &vs_org[VSSIZE];
@s| vs_limit = &vs_org[VSSIZE];
clear_stack(vs_top,vs_limit);
frs_org = frame_stack;
@s]
****Change:(orig (143 143 a))
@s[ frs_limit = &frs_org[FRSSIZE];
@s| frs_limit = &frs_org[FRSSIZE];
bds_org = bind_stack;
@s]
****Change:(orig (145 145 a))
@s[ bds_limit = &bds_org[BDSSIZE];
@s| bds_limit = &bds_org[BDSSIZE];
#ifdef KCLOVM
bds_save_org = save_bind_stack;
bds_save_top = bds_save_org - 1;
bds_save_limit = &bds_save_org[BDSSIZE];
#endif
ihs_org = ihs_stack;
@s]
****Change:(orig (150 150 a))
@s[ cs_org = &argc;
cssize = CSSIZE;
@s| cs_org = &argc;
cssize = CSSIZE;
#ifdef SIGSEGV
(void) signal(SIGSEGV,segmentation_catcher);
#endif
@s]
****Change:(orig (152 152 a))
@s[
#ifdef BSD
@s|
#ifdef BSD
#ifdef RLIMIT_STACK
@s]
****Change:(orig (154 154 a))
@s[ cssize = rl.rlim_cur/4 - 4*CSGETA;
@s| cssize = rl.rlim_cur/4 - 4*CSGETA;
#endif
@s]
****Change:(orig (187 187 a))
@s[ siVlisp_maxpages->s.s_dbind = make_fixnum(real_maxpage);
initflag = TRUE;
@s| siVlisp_maxpages->s.s_dbind = make_fixnum(real_maxpage);
initflag = TRUE;
#ifdef KCLOVM
ovm_user_context_change = change_contexts;
ovm_user_context_initialize = initialize_process;
v_init_processes();
ovm_process_created = 1;
#endif
again:
@s]
****Change:(orig (188 188 a))
@s[ super_funcall(siStop_level);
@s| super_funcall(siStop_level);
if (type_of(siLmultiply_stacks->s.s_dbind)==t_fixnum)
{multiply_stacks(fix(siLmultiply_stacks->s.s_dbind));
goto again;}
@s]
****Change:(orig (335 340 d))
@s[#ifdef AOSVS
#endif
@s|
@s]
****Change:(orig (351 351 a))
@s[ init_sequence_function();
@s| init_sequence_function();
#ifdef KCLOVM
init_socket_function();
#endif
@s]
****Change:(orig (363 367 d))
@s[#endif
#ifdef AOSVS
#endif
@s|#endif
@s]
****Change:(orig (388 388 a))
@s[ init_main();
init_format();
@s| init_main();
init_format();
init_links();
@s]
****Change:(orig (390 392 c))
@s[
#ifdef AOSVS
#endif
@s|
init_fat_string();
#ifdef CMAC
init_cmac();
#endif
@s]
****Change:(orig (450 450 c))
@s[ if (vs_limit > vs_org + VSSIZE)
@s| if (vs_limit > vs_org + stack_multiple * VSSIZE)
@s]
****Change:(orig (455 455 a))
@s[ FEerror("Value stack overflow.", 0);
}
@s| FEerror("Value stack overflow.", 0);
}
@s]
****Change:(orig (459 459 c))
@s[ if (bds_limit > bds_org + BDSSIZE)
@s| if (bds_limit > bds_org + stack_multiple * BDSSIZE)
@s]
****Change:(orig (468 468 c))
@s[ if (frs_limit > frs_org + FRSSIZE)
@s| if (frs_limit > frs_org + stack_multiple * FRSSIZE)
@s]
****Change:(orig (477 477 c))
@s[ if (ihs_limit > ihs_org + IHSSIZE)
@s| if (ihs_limit > ihs_org + stack_multiple * IHSSIZE)
@s]
****Change:(orig (482 482 a))
@s[ FEerror("Invocation history stack overflow.", 0);
}
@s| FEerror("Invocation history stack overflow.", 0);
}
segmentation_catcher()
{int x;
if (&x < cs_limit)
cs_overflow();
else
{printf("Segmentation violation: c stack ok:signalling error");
}
error("segmentation violation");
}
@s]
****Change:(orig (502 502 a))
@s[ error("end of file");
}
@s| error("end of file");
}
int sgc_enabled;
int catch_fatal=1;
@s]
****Change:(orig (504 504 a))
@s[error(s)
{
@s|error(s)
{
if (catch_fatal>0 && interrupt_enable )
{catch_fatal = -1;
#ifdef SIGSEGV
if (sgc_enabled==0)
(void) signal(SIGSEGV,segmentation_catcher);
#endif
FEerror("Caught fatal error [memory may be damaged]"); }
@s]
****Change:(orig (621 621 a))
@s[ FEerror("Value stack is flawed.", 0);
vs_base[0] = Cnil;
}
@s| FEerror("Value stack is flawed.", 0);
vs_base[0] = Cnil;
}
object
siLcatch_fatal(i)
{catch_fatal=i;
return Cnil;}
@s]
****Change:(orig (625 626 c))
@s[ if (vs_top < vs_org + VSSIZE)
vs_limit = vs_org + VSSIZE;
@s| if(catch_fatal <0) catch_fatal=1;
if (vs_top < vs_org + stack_multiple * VSSIZE)
vs_limit = vs_org + stack_multiple * VSSIZE;
@s]
****Change:(orig (629 630 c))
@s[ if (bds_top < bds_org + BDSSIZE)
bds_limit = bds_org + BDSSIZE;
@s| if (bds_top < bds_org + stack_multiple * BDSSIZE)
bds_limit = bds_org + stack_multiple * BDSSIZE;
@s]
****Change:(orig (633 634 c))
@s[ if (frs_top < frs_org + FRSSIZE)
frs_limit = frs_org + FRSSIZE;
@s| if (frs_top < frs_org + stack_multiple * FRSSIZE)
frs_limit = frs_org + stack_multiple * FRSSIZE;
@s]
****Change:(orig (637 638 c))
@s[ if (ihs_top < ihs_org + IHSSIZE)
ihs_limit = ihs_org + IHSSIZE;
@s| if (ihs_top < ihs_org + stack_multiple * IHSSIZE)
ihs_limit = ihs_org + stack_multiple * IHSSIZE;
@s]
****Change:(orig (653 653 a))
@s[ error("can't reset cs_limit");
vs_base[0] = Cnil;
}
@s| error("can't reset cs_limit");
vs_base[0] = Cnil;
}
#define COPYSTACK(org,p,typ,lim,top,geta,size) \
do{int leng,topl; \
bcopy(org,p,leng=(stack_multiple*size*sizeof(typ))); \
topl= top - org; \
org=(typ *)p; top = org +topl;\
p=p+leng+2*geta*sizeof(typ); \
lim = ((typ *)p) - 2*geta; \
}while (0)
multiply_stacks(m)
int m;
{ static object stack_space;
int n;
object x;
object gc_pro=stack_space;
char *p;
int vs,bd,frs,ihs;
stack_multiple=stack_multiple*m;
#define ELTSIZE(x) (((char *)((x)+1)) - ((char *) x))
vs = (stack_multiple*VSSIZE + 2*VSGETA)* ELTSIZE(vs_org);
bd = (stack_multiple*BDSSIZE + 2*BDSGETA)*ELTSIZE(bds_org);
frs = (stack_multiple*FRSSIZE + 2*FRSGETA)*ELTSIZE(frs_org);
ihs = (stack_multiple*IHSSIZE + 2*IHSGETA)*ELTSIZE(ihs_org);
if (stack_space==0) {enter_mark_origin(&stack_space);}
stack_space = alloc_simple_string(vs+bd+frs+ihs);
array_allocself(stack_space,1,code_char(0));
p=stack_space->st.st_self;
COPYSTACK(vs_org,p,object,vs_limit,vs_top,VSGETA,VSSIZE);
COPYSTACK(bds_org,p,struct bds_bd,bds_limit,bds_top,BDSGETA,BDSSIZE);
COPYSTACK(frs_org,p,struct frame,frs_limit,frs_top,FRSGETA,FRSSIZE);
COPYSTACK(ihs_org,p,struct invocation_history,ihs_limit,ihs_top,
IHSGETA,IHSSIZE);
vs_base=vs_top;
return stack_multiple;
}
@s]
****Change:(orig (702 702 c))
@s[ GBC(t_contiguous);
#ifdef BSD
@s| GBC(t_contiguous);
#if defined(BSD) || defined(ATT)
@s]
****Change:(orig (703 703 a))
@s[ brk(core_end);
@s| brk(core_end);
/* printf( "(breaking at core_end = %x in main ,)",core_end); */
@s]
****Change:(orig (766 766 a))
@s[ make_simple_string(system_directory));
@s| make_simple_string(system_directory));
{object features;
@s]
****Change:(orig (768 770 c))
@s[ make_special("*FEATURES*",
make_cons(make_ordinary("COMMON"),
make_cons(make_ordinary("KCL"), Cnil)));
@s|#define ADD_FEATURE(name) \
features= make_cons(make_ordinary(name),features)
@s]
****Change:(orig (772 779 c))
@s[#ifdef VAX
make_special("*FEATURES*",
make_cons(make_ordinary("VAX"),
make_cons(make_ordinary("UNIX"),
@s, make_cons(make_ordinary("KCL"), Cnil))))));
#endif
@s| features= make_cons(make_ordinary("COMMON"),
make_cons(make_ordinary("KCL"), Cnil));
ADD_FEATURE("AKCL");
@s]
****Change:(orig (781 789 c))
@s[#ifdef SUN
make_special("*FEATURES*",
make_cons(make_ordinary("SUN"),
make_cons(make_ordinary("MC68K"),
@s, make_cons(make_ordinary("KCL"), Cnil))))))));
@s|#ifdef UNIX
ADD_FEATURE("UNIX");
@s]
****Change:(orig (791 800 c))
@s[
#ifdef SUN2R3
make_special("*FEATURES*",
make_cons(make_ordinary("SUN"),
@s, make_cons(make_ordinary("KCL"), Cnil))))))));
@s|#ifdef IEEEFLOAT
ADD_FEATURE("IEEE-FLOATING-POINT");
@s]
****Change:(orig (802 811 c))
@s[
#ifdef SUN3
make_special("*FEATURES*",
make_cons(make_ordinary("SUN"),
@s, make_cons(make_ordinary("KCL"), Cnil))))))));
@s|#ifdef SGC
ADD_FEATURE("SGC");
#endif
#ifdef ADDITIONAL_FEATURES
ADDITIONAL_FEATURES;
@s]
****Change:(orig (813 822 c))
@s[
#ifdef NEWS
make_special("*FEATURES*",
make_cons(make_ordinary("NEWS"),
@s, make_cons(make_ordinary("KCL"), Cnil))))))));
@s|#ifdef BSD
ADD_FEATURE("BSD");
@s]
****Change:(orig (823 823 a))
@s[#endif
@s|#endif
make_special("*FEATURES*",features);}
@s]
****Change:(orig (825 902 d))
@s[#ifdef ISI
#endif
@s,#ifdef AOSVS
#endif
@s|
@s]
****Change:(orig (903 903 a))
@s[ make_si_function("SAVE-SYSTEM", siLsave_system);
@s| make_si_function("SAVE-SYSTEM", siLsave_system);
make_si_sfun("CATCH-FATAL",siLcatch_fatal,ARGTYPE1(f_fixnum));
siLmultiply_stacks=make_si_special("*MULTIPLY-STACKS*",Cnil);
@s]